<template>
  <a-config-provider :locale="locale" :getPopupContainer="getPopupContainer">
    <div id="app" style="position: relative">
      <router-view />
    </div>
  </a-config-provider>
</template>
<script>
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import Vue from 'vue'
import { SCENE_NO } from '@/store/mutation-types'
export default {
  data () {
    return {
      locale: zhCN
    }
  },
  mounted () {
    this.$nextTick(function () {
      this.init()
    })
  },
  methods: {
    init () {},
    getPopupContainer (node) {
      if (node) {
        return node.parentNode
      }
      return document.body
    }
  },
  watch: {
    $route (to) {
      Vue.ls.set(SCENE_NO, to.meta.sceneNo)
      // 菜单高亮控制
      this.$store.commit('setMenuActive', to.path)
      // 面包屑导航控制
      this.$store.commit('setBreadList', to.matched)
      // 全局path控制setFullPath
      this.$store.commit('setFullPath', to.fullPath)
    }
  }
}
</script>
<style>
#app {
  height: 100%;
}
</style>
